﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZhimeiSoft.CharmManager.Server.DAL
{
    public class CustomerReturnVisitDAL_Const
    {
        public static readonly string SQL_INSERT_CUSTOMERRETURNVISIT = @"INSERT INTO CUSTOMERRETURNVISIT(
            CUSTOMERID, CRETURNVISITTIME, CMEMO, CEMPLOYEEID) VALUES (
            @CUSTOMERID, @CRETURNVISITTIME, @CMEMO, @CEMPLOYEEID)";

        public static readonly string SQL_UPDATE_CUSTOMERRETURNVISIT = @"UPDATE CUSTOMERRETURNVISIT SET 
            CUSTOMERID=@CUSTOMERID, CRETURNVISITTIME=@CRETURNVISITTIME, CMEMO=@CMEMO, CEMPLOYEEID=@CEMPLOYEEID
            WHERE CRETURNVISITID=@CRETURNVISITID";

        public static readonly string SQL_DELETE_CUSTOMERRETURNVISIT = @"DELETE FROM CUSTOMERRETURNVISIT
            WHERE CRETURNVISITID=@CRETURNVISITID";

        public static readonly string SQL_QUERY_CUSTOMERRETURNVISIT = @"SELECT 
            A.*, B.CNAME AS 'CUSTOMERNAME', C.ENAME AS 'CEMPLOYEENAME'
            FROM CUSTOMERRETURNVISIT A 
                LEFT JOIN CUSTOMINFO B ON A.CUSTOMERID=B.CUSTOMERID
                LEFT JOIN EMPLOYEEINFO C ON A.CEMPLOYEEID=C.EMPLOYEEID";
    }
}
